package master;


import java.util.Scanner;

/**
 * @author chenyw
 * @date 2022/9/11 11:08
 */
public class M223computeArea {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int i1 = scanner.nextInt();
        int i2 = scanner.nextInt();
        int i3 = scanner.nextInt();
        int i4 = scanner.nextInt();
        int i5 = scanner.nextInt();
        int i6 = scanner.nextInt();
        int i7 = scanner.nextInt();
        int i8 = scanner.nextInt();

        int i = computeArea(i1, i2, i3, i4, i5, i6, i7, i8);
        System.out.println(i);
    }
    public static int computeArea(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2) {
        int a = (ax2 - ax1) * (ay2 - ay1);
        int b = (bx2 - bx1) * (by2 - by1);
        int res = a + b;
        int overWidth = (Math.min(ax2, bx2) - Math.max(ax1, bx1));
        int overHigh = (Math.min(ay2, by2) - Math.max(ay1, by1));
        res -= Math.max(0, overHigh) * Math.max(0, overWidth);
        return res;
    }
}
